package com.joysuch.wwyt.bp.entity.risk;

import com.joysuch.wwyt.core.support.AutoSetCommonFieldListener;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * 风险研判-班组-风险研判
 * @Author ZhangDong
 * @Date 2020/3/4 12:12
 */
@EntityListeners({ AuditingEntityListener.class, AutoSetCommonFieldListener.class })
@Entity
@Table(name = "wwyt_bp_judge_team_risk_judge")
@SQLDelete(sql="update wwyt_bp_judge_team_risk_judge set DELETE_FLAG = '1' where id= ?")
@SQLDeleteAll(sql="update wwyt_bp_judge_team_risk_judge set DELETE_FLAG = '1' where id= ?")
@Where(clause="DELETE_FLAG = '0'")
@Data
public class BpTeamRiskJudge {

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @ApiModelProperty("主键id")
    private Long id;

    @ApiModelProperty("班组表id")
    private Long teamId;

    @ApiModelProperty("存在的风险")
    private String existRiskName;

    @ApiModelProperty("采取的安全措施")
    private String safeMethod;

    @ApiModelProperty("风险等级")
    private String riskLevel;

    @ApiModelProperty("是否有重大事故隐患")
    private String existAccidentRiskOrNot;

    //通用字段
    @ApiModelProperty("创建人")
    @org.springframework.data.annotation.CreatedBy
    private Long createBy;

    @ApiModelProperty("创建时间")
    @org.springframework.data.annotation.CreatedDate
    private java.time.LocalDateTime createTime;

    @ApiModelProperty("更新人")
    @org.springframework.data.annotation.LastModifiedBy
    private Long updateBy;

    @ApiModelProperty("更新时间")
    @org.springframework.data.annotation.LastModifiedDate
    private java.time.LocalDateTime updateTime;

    @ApiModelProperty("租户")
    private Long tenentId;

    @ApiModelProperty("组织机构代码")
    private String orgCode;

    @ApiModelProperty("删除标记")
    private String deleteFlag;
}
